#include <iostream>
#include <unordered_set>

using namespace std;
/**
 * 找球号
 */
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    unordered_set<int> balls;

    int m, n;
    cin >> m >> n;

    for(int i = 0; i < m; i++){
        int ball;
        cin >> ball;
        balls.insert(ball);
    }


    for(int i = 0; i < n; i++){
        int ball;
        cin >> ball;
        if(balls.count(ball)){
            cout << "YES\n";
        }else{
            cout << "NO\n";
        }
    }

    return 0;

}
